#pragma once

#include "GetPot"
#include <string>
#include <memory>
#include "Logging.h"

class Parser
{
public:
  Parser();
  ~Parser() {  }

  template<typename T>
  T Get(const std::string& group_name, const std::string& name)
  {
    try
    {
      _cf->set_prefix(group_name + "/");
      return _cf->get<T>(name);
    }
    catch (const std::exception& e)
    {
      Error(e.what());
    }
    
  }

private:
  std::string _ifile;

  std::shared_ptr<GetPot> _cf;
};
